package com.ruoyi.system.service.impl;

import java.util.List;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.system.domain.SysAttendanceRecord;
import com.ruoyi.system.mapper.SysAttendanceRecordMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.SysCourseContentMapper;
import com.ruoyi.system.domain.SysCourseContent;
import com.ruoyi.system.service.ISysCourseContentService;

/**
 * 课程内容Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-04-21
 */
@Service
public class SysCourseContentServiceImpl extends ServiceImpl<SysCourseContentMapper, SysCourseContent> implements ISysCourseContentService
{
    @Autowired
    private SysCourseContentMapper sysCourseContentMapper;

    /**
     * 查询课程内容
     * 
     * @param id 课程内容主键
     * @return 课程内容
     */
    @Override
    public SysCourseContent selectSysCourseContentById(Long id)
    {
        return sysCourseContentMapper.selectSysCourseContentById(id);
    }

    /**
     * 查询课程内容列表
     * 
     * @param sysCourseContent 课程内容
     * @return 课程内容
     */
    @Override
    public List<SysCourseContent> selectSysCourseContentList(SysCourseContent sysCourseContent)
    {
        return sysCourseContentMapper.selectSysCourseContentList(sysCourseContent);
    }

    /**
     * 新增课程内容
     * 
     * @param sysCourseContent 课程内容
     * @return 结果
     */
    @Override
    public int insertSysCourseContent(SysCourseContent sysCourseContent)
    {
        sysCourseContent.setCreateTime(DateUtils.getNowDate());
        return sysCourseContentMapper.insertSysCourseContent(sysCourseContent);
    }

    /**
     * 修改课程内容
     * 
     * @param sysCourseContent 课程内容
     * @return 结果
     */
    @Override
    public int updateSysCourseContent(SysCourseContent sysCourseContent)
    {
        sysCourseContent.setUpdateTime(DateUtils.getNowDate());
        return sysCourseContentMapper.updateSysCourseContent(sysCourseContent);
    }

    /**
     * 批量删除课程内容
     * 
     * @param ids 需要删除的课程内容主键
     * @return 结果
     */
    @Override
    public int deleteSysCourseContentByIds(Long[] ids)
    {
        return sysCourseContentMapper.deleteSysCourseContentByIds(ids);
    }

    /**
     * 删除课程内容信息
     * 
     * @param id 课程内容主键
     * @return 结果
     */
    @Override
    public int deleteSysCourseContentById(Long id)
    {
        return sysCourseContentMapper.deleteSysCourseContentById(id);
    }
}
